package com.businesswebsite.businesswebsite.FormalWebExplot.Service.impl.Appointment;

import com.businesswebsite.businesswebsite.FormalWebExplot.Dao.Appointment.AppointmentDao;
import com.businesswebsite.businesswebsite.FormalWebExplot.Entity.Appointment;
import com.businesswebsite.businesswebsite.FormalWebExplot.Service.Appointment.AppointmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Author: 段美超
 * @CreateTime: 2025-05-20
 * @Description: 预约接口实现
 * @Version: 1.0
 */
@Service
public class AppointmentServiceImpl implements AppointmentService {
    @Autowired
    private AppointmentDao appointmentDao;
    @Override
    public Integer MakeAppointment(Appointment appointment) {
        if(appointment == null){
            return null;
        }
        if(appointment.getDetail_content() == null && appointment.getProduct_type() == null){
            return null;
        }
        Integer record = appointmentDao.MakeAppointment(appointment);
        if(record > 0 ){
            return record;
        }
        return null;
    }
}
